// Copyright 2011, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Hannah Bast <bast>.

// This program opens a file and counts the
// whitespace-separated words in that file.

#include <iostream>
#include <string>
using std::cout;
using std::cin;
using std::endl;
using std::string;

int main()
{
  int nwords = 0;
  string word;

  while (cin >> word)
  {
    ++nwords;
  }

  cout << "Number of words = " << nwords << endl;

  return 0;
}
